package pers.cz.pub;

/**
 * 公共响应类
 * @program: PostGirl-panent
 * @description: RespBean
 * @author: Cheng Zhi
 * @create: 2021-03-11 12:53
 **/
public class RespBean {
    private Integer status;
    private String msg;
    private Object obj;
    private String token;

    public static RespBean ok(String msg) {
        return new RespBean(200,msg,null);
    }

    public static RespBean ok(String msg, Object obj) {
        return new RespBean(200,msg,obj);
    }

    public static RespBean ok(String msg, Object obj, String token) {
        return new RespBean(200, msg, obj, token);
    }

    public static RespBean error(String msg) {
        return new RespBean(500,msg,null);
    }

    public static RespBean error(String msg, Object obj) {
        return new RespBean(500,msg,obj);
    }
    private RespBean() {

    }

    private RespBean(Integer status, String msg, Object obj) {
        this.status = status;
        this.msg = msg;
        this.obj = obj;
    }

    private RespBean(Integer status, String msg, Object obj, String token) {
        this.status = status;
        this.msg = msg;
        this.obj = obj;
        this.token = token;
    }
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getObj() {
        return obj;
    }

    public void setObj(Object obj) {
        this.obj = obj;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }
}
